import {
    http4
} from "@/service/axios";

// 计费规则列表
export function getCparkRule(data) {
    return http4.get({
        url: '/cpark/charge/rule/list/page',
        params: data
    })
}

// 新增计费规则
export function getAddCpark(data) {
    return http4.post({
        url: '/cpark/charge/rule/add',
        data
    })
}

// 编辑计费规则
export function getEditCpark({
    id,
    data
}) {
    return http4.put({
        url: `/cpark/charge/rule/edit/${id}`,
        data
    })
}

// 根据规则获取车场列表（已绑和可绑）接口
export function getCparkChargeRuleLotList(id) {
    return http4.get({
        url: `/cpark/charge/rule/lot/list/${id}`,
    })
}

// 规则关联车场接口
export function postCparkChargeRuleLotBind(id, data) {
    return http4.post({
        url: `/cpark/charge/rule/lot/bind/${id}`,
        data
    })
}

// 获取计费规则表单接口
export function getCparkChargeRuleForm(id) {
    return http4.get({
        url: `/cpark/charge/rule/form/${id}`,
    })
}

// 编辑计费规则接口